﻿using Microsoft.Extensions.Configuration;
using System;

namespace JsonConfigurationSample
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            try
            {
                JsonConfigurationSample(args);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.ReadKey();
        }

        private static void JsonConfigurationSample(string[] args)
        {
            var builder = new ConfigurationBuilder()
                .AddJsonFile("class.json",false,true);

            var config = builder.Build();

            Console.WriteLine($"{config["className"]}\t{config["classId"]}");
        }
    }
}
